package com.lai.shop.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 *
 * @author laiciqi
 * @email 602469238@qq.com
 * @date 2022-05-19 13:16:52
 */
@Data
@TableName("category")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CategoryEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	@TableId
	private Long id;
	/**
	 * 类别名称
	 */
	private String categoryName;
	/**
	 * 父类别id
	 */
	private Long parentId;

	/**
	 * 层级
	 */
	private Integer catLevel;
	/**
	 * 是否禁用(0:是 1：否)
	 */
	private Integer isDisable;

	/**
	 * 商品类型
	 */
	private String type;
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;
	/**
	 * 更新时间
	 */
	@TableField(fill = FieldFill.UPDATE)
	private Date updateTime;


	/**
	 * 商品子分类
	 */
	@JsonInclude(JsonInclude.Include.NON_EMPTY) //如果不为空的时候 才会返回该字段
	@TableField(exist = false) //表示不是数据表里面的字段
	private List<CategoryEntity> children;

}
